<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:popupPanel id="popupEditar" modal="true" autosized="true"
		resizeable="false" domElementAttachment="parent"
		style="left: 485px; top: 253px;">

		<f:facet name="header">
			<h:outputText value="#{msg.usuarioEditarTittle}" />
		</f:facet>
		<f:facet name="controls">
			<h:commandButton value="X">
				<rich:componentControl target="popupEditar" operation="hide" />
			</h:commandButton>
		</f:facet>
		<h:form id="popupEditarForm">
			<h:panelGrid id="panelEditar" columns="3">
				<h:outputLabel value="#{msg.username}" />
				<h:inputText id="username"
					value="#{usuarioBean.usuarioSelected.username}" required="true"
					readonly="#{facesContext.renderResponse}"
					requiredMessage="#{msg.requiredUsername}" />
				<rich:message for="username" />
				<h:outputLabel value="#{msg.password}" />
				<h:inputText id="password"
					value="#{usuarioBean.usuarioSelected.password}" required="true"
					requiredMessage="#{msg.requiredPassword}" />
				<rich:message for="password" />
				<h:outputLabel value="Rol" />
				<rich:select id="rol" value="#{usuarioBean.usuarioSelected.rol}"
					required="true" requiredMessage="#{msg.requiredRol}">
					<f:selectItem itemValue="Admin" itemLabel="#{msg.admin}" />
					<f:selectItem itemValue="Profesor" itemLabel="#{msg.profesor}" />
				</rich:select>
				<rich:message for="rol" />
				<h:outputLabel value="#{msg.estado}" />
				<rich:select id="estado"
					value="#{usuarioBean.usuarioSelected.estado}" required="true"
					requiredMessage="#{msg.requiredEstado}">
					<f:selectItem itemValue="Activo" itemLabel="#{msg.activo}" />
					<f:selectItem itemValue="Inactivo" itemLabel="#{msg.inactivo}" />
				</rich:select>
				<rich:message for="estado" />

				<p />
				<a4j:commandButton value="#{msg.guardar}"
					actionListener="#{usuarioBean.modificarUsuario}"
					oncomplete="#{rich:component('popupEditar')}.hide(); return false;"
					render="panelListadoUsuarios">
				</a4j:commandButton>
			</h:panelGrid>
		</h:form>
	</rich:popupPanel>
</ui:composition>